package com.example.demo.util;

import com.example.demo.entity.Result;

/**
 * Created by 13795 on 2017/7/5.
 */
public class ResultUtils {
    public static  Result success(Object object){
        Result result = new Result();
        result.setCode("001");
        result.setMsg("请求成功");
        result.setData(object);
        return result;
    }
    public static  Result success(){
        return success(null);
    }
    public static Result fails(){
        Result result = new Result();
        result.setCode("002");
        result.setMsg("请求失败");
        return result;
    }
    public static Result fails(String msg){
        Result result = new Result();
        result.setCode("002");
        result.setMsg(msg);
        return result;
    }

}
